<?php

/**
* Validation API
* 
* @version 1.0.2
* @Copyright (C) 2012 Jason Bourne
* @ All rights reserved
**/

class sb_validate {

	public function steam($steamid){
		return preg_match('/\bSTEAM_([0-9]{1}):([0-9]{1}):([0-9])+$/', $steamid) ? '1' : '0';
	}
	
	public function email($email){
		return preg_match("/^(\w+((-\w+)|(\w.\w+))*)\@(\w+((\.|-)\w+)*\.\w+$)/",$email) ? '1' : '0';
	}
	
	public function username($username){
		if (substr_count($username, '\'')==0 AND strlen($username)<65){
			return 1;
		}else{
			return 0;
		}
	}
	
	public function group($group){
		if (ctype_alpha($group) AND strlen($group)<129){
			return 1;
		}else{
			return 0;
		}
	}
	
	public function flags($flags){
		if (ctype_alpha($flags) AND strlen($flags)<65){
			return 1;
		}else{
			return 0;
		}
	}
	
	public function immunity($immunity){
		if (is_int($immunity) == true AND $immunity > 0 AND $immunity<100){
			return 1;
		}else{
			return 0;
		}
	}
	public function id($id){
		if (is_int($id) == true AND $id > 0){
			return 1;
		}else{
			return 0;
		}
	}
}
?>
